package com.example.ai.tool;

import com.example.ai.demo.invoke.tool.FileOperationTool;
import org.springframework.ai.tool.ToolCallback;
import org.springframework.ai.tool.ToolCallbacks;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ToolRagistration {
    @Value("${search.api.api-key}")
    private String searchApikey;

    @Bean
    public ToolCallback[] getTool(){
        FileOperationTool fileOperationTool = new FileOperationTool();
        WebSearchTool webSearchTool = new WebSearchTool(searchApikey);
        WebScrapingTool webScrapingTool = new WebScrapingTool();
        ResourceDowmloadTool resourceDowmloadTool = new ResourceDowmloadTool();
        TerminalOperationTool terminalOperationTool = new TerminalOperationTool();
        PDFGenerationTool pdfGenerationTool = new PDFGenerationTool();
        TerminateTool terminateTool = new TerminateTool();
        return ToolCallbacks.from(
                fileOperationTool,
                webSearchTool,
                webScrapingTool,
                resourceDowmloadTool,
                terminalOperationTool,
                pdfGenerationTool,
                terminateTool);

    }
}
